package com.wt.admin.controller.ai;


import com.aizuda.easy.security.domain.Rep;
import com.wt.admin.domain.dto.ai.KnowledgeInfoDTO;
import com.wt.admin.domain.dto.ai.KnowledgeTitleDTO;
import com.wt.admin.domain.vo.ai.KnowledgeInfoVO;
import com.wt.admin.domain.vo.ai.KnowledgeTitleVO;
import com.wt.admin.service.ai.KnowledgeProxyService;
import com.wt.admin.util.PageUtil;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("knowledge")
public class KnowledgeController {

    @Resource
    private KnowledgeProxyService knowledgeProxyService;

    @PostMapping("titleList")
    public Rep<List<KnowledgeTitleVO>> titleList(@RequestBody KnowledgeTitleDTO data) {
        return Rep.ok(knowledgeProxyService.getKnowledgeTitleService().titleList(data));
    }

    @PostMapping("titleEdit")
    public Rep<KnowledgeTitleVO> titleEdit(@RequestBody KnowledgeTitleDTO data) {
        return Rep.ok(knowledgeProxyService.getKnowledgeTitleService().titleEdit(data));
    }

    @PostMapping("titleDel")
    public Rep<KnowledgeTitleVO> titleDel(@RequestBody KnowledgeTitleDTO data) {
        return Rep.ok(knowledgeProxyService.titleDel(data));
    }


    @PostMapping("infoList")
    public Rep<PageUtil.PageVO<KnowledgeInfoVO>> infoList(@RequestBody PageUtil.PageDTO<KnowledgeInfoDTO> data) {
        return Rep.ok(knowledgeProxyService.getKnowledgeInfoService().infoList(data));
    }

    @PostMapping("infoEdit")
    public Rep<KnowledgeInfoVO> infoEdit(@RequestBody KnowledgeInfoDTO data) {
        return Rep.ok(knowledgeProxyService.getKnowledgeInfoService().infoEdit(data));
    }

    @PostMapping("infoDel")
    public Rep<KnowledgeInfoVO> infoDel(@RequestBody KnowledgeInfoDTO data) {
        return Rep.ok(knowledgeProxyService.getKnowledgeInfoService().infoDel(data));
    }


}
